<?php
	@session_start();
	if($_SESSION['LoginId'] == false){
		header("Location:login.php");
	}
	require_once 'model/common.php';
	
	$sql="log order by id DESC";
	$totals=$commonc->getNum($sql);
	$num=10;
	if($_GET['num']!=false){
		$num=$_GET['num'];
	}
	$tpn->pageft($totals,$num);
	if($tpn->getfirstcount()<0)
	$tpn->setfirstcount(0);
	$result=$commonc->query($sql." limit ".$tpn->getfirstcount().",".$num);
	while($row=mysql_fetch_array($result)){
		$logs[]=$row;
	}
	
	$smarty->assign("num",$num);
	$smarty->assign("logs",$logs);
	$smarty->assign('pages',$tpn->getpagenav());
	$smarty->display("log.html");
?>